#ifndef FORMATTINGTOOLBAR_H
#define FORMATTINGTOOLBAR_H

#include <QObject>
#include <QToolBar>
#include <QIcon>
#include <QAction>
#include <QComboBox>
#include <QFontComboBox>
#include <QColorDialog>
#include <QTextList>
#include <QTextBlock>
#include <QTextCursor>
#include <QColor>
#include <QFileDialog>
#include <QTextDocumentFragment>

#include "constants.h"
#include "Editor/tablesizewidget.h"
#include "Editor/formattededitor.h"

class FormattedEditor;

class FormattingToolBar : public QToolBar
{
	Q_OBJECT

	public:
		FormattingToolBar(FormattedEditor *newEditor);

	public slots:
		void setBold(const bool newBold);
		void setFont();
		void setFontSize();
		void setFontSize(const QString newSize);
		void setLeftAlign(const bool align);
		void setCentreAlign(const bool align);
		void setRightAlign(const bool align);
		void setJustifyAlign(const bool align);
		void setBulletFormatter(const bool bulletsOn);
		void setNumberFormatter(const bool numbersOn);
		void chooseFontColour();
		void chooseFontBackgroundColor();
		void addImage();
		void addTable();

		void matchCurrentFormat();

	private:
		QAction *bold;
		QAction *italic;
		QAction *underline;
		QFontComboBox *font;
		QComboBox *fontSize;
		QAction *leftAlign;
		QAction *centreAlign;
		QAction *rightAlign;
		QAction *justifyAlign;
		QAction *bullets;
		QAction *numbers;
		QAction *colour;
		QAction *textBackgroundColour;
		QAction *image;
		QAction *table;

		QImage *colourImage;
		QImage *backColourImage;
		static const QRgb maskedColour;     //the colour that is to be replaced in the colouring icons
		int colourMaskIndex;                //the index of said colour in colour table
		int backColourMaskIndex;            //ditto for background colour

		FormattedEditor *editor;
};

#endif // FORMATTINGTOOLBAR_H
